#include<iostream>
#include <stdio.h>
using namespace std;
int main()
{int m,n,x,y,a;
 while(cin>>m) 
   {a=m;
    for(int i=1;;i++)
      {if(m>i*(i+1)/2&&m<=(i+1)*(i+2)/2)  {n=i;break;}  }
    m=m-n*(n+1)/2;
    if(n%2!=0)    {x=m;y=n+2-x;}
    else          {y=m;x=n+2-y;}
    cout<<"TERM "<<a<<" IS "<<x<<"/"<<y<<endl;
   }
system("pause");
return 0;
}
    
     
